<?php

namespace app\api\validate;
use think\Validate;

class Travel extends Validate{
    protected $rule = [
        'type'         =>'require|in:0,1', // 类型：0国内|1国外
        'user_scale'   =>'require',// 预计人数
        'begintime'    =>'require', // 开始时间
        'endtime'      => 'require',// 结束时间

        'travel_id'       => 'require',
        'activity_ids'    => 'require',


        'name'     =>'require', // 场地：场地名称|活动：活动名称|老师：课程名称
        'address'  =>'require', // 场地：场地地址
        'max_num'  =>'require', // 场地：可承载人数|活动：可承载人数
        'fee'      =>'require', // 场地：费用|活动：活动价格
        'is_house' =>'require', // 场地：是否包含住宿
        'square'   =>'require', // 场地：面积
        //'extra_service' => 'require', // 场地：场外提供的额外服务
        'is_metro'    =>'require', // 场地：附近是否有地铁
        'park_number' =>'require',// 场地：停车场数量
        'is_ticket' =>'require',// 场地：是否能开发票|活动：活动安排
        'category'  =>'require',// 活动：活动类型
        'time'      =>'require',// 活动：活动时长
        'city_id'   =>'require',// 活动：活动地区
        'is_site'   =>'require',// 活动：是否提供场地
        'plan'      =>'require',// 活动：活动安排
        
        'poster'    => 'require',
        'titles'    => 'require',
        'category'  => 'require',
        'diy_desc'  => 'require',
        'begintime' => 'require',
        'endtime'   => 'require',
        'address'   => 'require',
        'city'      => 'require',
    ];

    protected $message = [
        'type.require'          =>  10006,
        'user_scale.require'    =>  10007,
        'begintime.require'     =>  10008,
        'endtime.require'       =>  10009,

        'travel_id.require'     =>  10010,
        'activity_ids.require'  =>  10011,

        'poster'                =>  30019,
        'titles'                =>  30020,
        'category'              =>  30032,
        'diy_desc'              =>  30037,
        'begintime'             =>  10008,
        'endtime'               =>  10009,
        'address'               =>  30002,
        'city'                  =>  30003,
    ];

    protected $scene = [
        'base' => ['type','user_scale','begintime','endtime'],
        'choose' => ['travel_id','activity_ids'],
        'site' => ['poster','name','address','max_num','fee','is_house','square','begintime','endtime','is_metro','park_number','is_ticket'],
        'activity' => ['poster','name','category','time','fee','max_num','city_id','is_site','plan','is_ticket'],
        'generate'     =>  ['travel_id'],// 场地商注册
        'overseabase' => ['type','begintime','endtime'],
        'addsite' => ['travel_id'],
        'diy' => ['poster','titles','category','diy_desc','begintime','endtime','address','city'],
    ];
}